home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / MEMCPY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  525 b   |  13 lines

  1. /* memcpy.c, from p.152 of Turbo C Bible  */
  2. /* Copies a specified number of bytes of from one buffer to another
  3.          (not for overlapping source and destination). */
  4. #include <stdio.h>
  5. #include <mem.h>
  6. static char src[81] = "This is the SOURCE buffer\n";
  7. static char dest[81] = "Destination\n";
  8. main()
  9. {
  10.     printf("Before memcpy: Source = %s Destination = %s\n", src, dest);
  11.     memcpy(dest, src, 80);     /* Copy from source to destination     */
  12.     printf("After  memcpy: Source = %s Destination = %s\n", src, dest);
  13. }